package cn.virens.common.spring.filter;

import org.dromara.hutool.core.collection.CollUtil;

import java.util.List;
import java.util.function.Consumer;

public class AbstractPathMatcherProperties {
    protected List<String> whitePatterns;
    protected List<String> blackPatterns;

    private Boolean enabled;

    public void pushWhitePatterns(Consumer<String> consumer) {
        if (CollUtil.isNotEmpty(whitePatterns)) {
            this.whitePatterns.forEach(consumer);
        }
    }

    public void pushBlackPatterns(Consumer<String> consumer) {
        if (CollUtil.isNotEmpty(blackPatterns)) {
            this.blackPatterns.forEach(consumer);
        }
    }

    public void setBlackPatterns(List<String> blackPatterns) {
        this.blackPatterns = blackPatterns;
    }

    public void setWhitePatterns(List<String> whitePatterns) {
        this.whitePatterns = whitePatterns;
    }

    public List<String> getBlackPatterns() {
        return blackPatterns;
    }

    public List<String> getWhitePatterns() {
        return whitePatterns;
    }
}
